import { getEleById } from './utils';
interface History {
    push: any;
}
const history: History = {
    push: (path: string) => {
        const root = getEleById('root');
        let a: any = getEleById('rootHistorylink');
        if (!a) {
            a = document.createElement('a');
            a.id = 'rootHistorylink';
            a.style.display = 'block';
            a.style.height = '0px';
            a.style.width = '0px';
            a.style.overflow = 'hidden';
        }

        a.href = '#' + path;
        root?.appendChild(a);
        a.click();
        root?.removeChild(a);
    },
};

export default history;
